function searchInsert(nums: number[], target: number): number {
    let low = 0;
    let hight = nums.length - 1;

    while (low <= hight) {
        const mid = Math.floor((hight - low) / 2) + low;
        if (target === nums[mid]) {
            console.log(mid);
            return mid;
        } else if (target < nums[mid]) {
            // 小于的时候 在左半区
            hight = mid - 1;
        } else {
            low = mid + 1;
        }
    }
    console.log(low);
    return low;
};

const nums6 = [1,3,5,6], target2 = 7 ;
searchInsert(nums6, target2)